﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Model="clr-namespace:ChumChase.Model"
                    xmlns:s="clr-namespace:ChumChase.Controls.Semantic">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ColorsAndBrushes.xaml" />
        <ResourceDictionary Source="ScrollBar.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--
    These styles are by no means a model. They need some serious cleanup.
    But it's Friday, and I got stuff to do.
    -->

    <FontFamily x:Key="DefaultFont">Segoe UI</FontFamily>

    <Style TargetType="ScrollBar">
        <Setter Property="Template"
                Value="{StaticResource ScrollBarTemplate}" />
    </Style>

    <Style TargetType="TextBlock">
        <Setter Property="FontFamily"
                Value="{StaticResource DefaultFont}" />
        <Setter Property="FontSize"
                Value="12" />
    </Style>

    <Style TargetType="Label">
        <Setter Property="FontFamily"
                Value="{StaticResource DefaultFont}" />
        <Setter Property="FontSize"
                Value="12" />
        <Setter Property="FontWeight"
                Value="Bold" />
        <Setter Property="HorizontalAlignment"
                Value="Right" />
    </Style>

    <Style TargetType="TextBox">
        <Setter Property="FontFamily"
                Value="{StaticResource DefaultFont}" />
        <Setter Property="FontSize"
                Value="12" />
    </Style>

    <Style TargetType="Button">
        <Setter Property="Background"
                Value="{StaticResource DisabledBrush}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource DraggingBrush}" />
        <Setter Property="Foreground"
                Value="Black" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border CornerRadius="4"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="2"
                            Padding="6 4"
                            Margin="2">
                        <ContentPresenter TextBlock.FontWeight="Bold"
                                          TextBlock.Foreground="{TemplateBinding Foreground}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="BorderBrush"
                        Value="{StaticResource MouseOverBrush}" />
            </Trigger>
            <Trigger Property="IsPressed"
                     Value="True">
                <Setter Property="Background"
                        Value="{StaticResource MouseOverBrush}" />
                <Setter Property="Foreground"
                        Value="{StaticResource DisabledBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <DataTemplate DataType="{x:Type Model:IFeedEntry}">
        <Border CornerRadius="4,4,4,4"
                BorderThickness="1,0.5,0.5,1"
                BorderBrush="#FF6C6C6C"
                Margin="0 2"
                Padding="4,4,4,4">
            <DockPanel>
                <Grid DockPanel.Dock="Left">
                    <Image Width="50"
                           Height="50"
                           Source="{Binding Path=User, Converter={StaticResource NicknameToProfilePicUrl}}"
                           Margin="2,2,8,8" />
                    <Image Width="16"
                           Height="16"
                           VerticalAlignment="Bottom"
                           Margin="2"
                           Source="{Binding Path=ServiceIcon}"
                           HorizontalAlignment="Right" />
                </Grid>

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Path=Title}"
                               TextWrapping="Wrap"
                               FontSize="16" />
                    <TextBlock Grid.Row="1"
                               Text="{Binding Path=Service}" />
                </Grid>
            </DockPanel>
        </Border>
    </DataTemplate>

    <Style TargetType="s:ButtonBar">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Right" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>